//
//  StudentAdmTry.m
//  ZHZtest
//
//  Created by 李彦宏 on 2018/1/9.
//  Copyright © 2018年 LYH. All rights reserved.
//

#import "StudentAdmTry.h"
#import "GraduateDisCtry.h"//研究生分配情况
#import "LookOverInfoCtry.h"//查看修改学员信息
#import "JWStuClockCtryVC.h"//教务端学生打卡




@interface StudentAdmTry ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *StudentAdmTab;
@property (nonatomic, strong) NSArray *AdmlistArry;


@end

@implementation StudentAdmTry
//UItableView初始化
- (void)setupTable
{
    UITableView *tableView=[[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    //隐藏组距导航栏的间距
    tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];
    tableView.backgroundColor=[UIColor whiteColor];
    tableView.showsHorizontalScrollIndicator=NO;
    tableView.showsVerticalScrollIndicator=NO;
    tableView.dataSource=self;
    tableView.delegate=self;
    tableView.separatorStyle=UITableViewCellSeparatorStyleSingleLine;
    [self.view addSubview:tableView];
    self.StudentAdmTab=tableView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupTable];
    self.title=@"学员管理";
    _AdmlistArry=[NSArray arrayWithObjects:@"打卡", @"分配研究生情况",@"查看/修改学员信息",nil];
    
    // Do any additional setup after loading the view.
}

#pragma -mark -----------------------------tableview datasource and delegate---------------------------------
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _AdmlistArry.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 45;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
    // 1.创建cell
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    }
    
    // 2.设置cell的数据
    cell.textLabel.text = _AdmlistArry[indexPath.row];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.StudentAdmTab deselectRowAtIndexPath:indexPath animated:YES];
    //跳转
    NSArray *arry=@[@"JWStuClockCtryVC",@"GraduateDisCtry",@"LookOverInfoCtry"];
    UIViewController *vc=[NSClassFromString(arry[indexPath.row])new];
    [self.navigationController pushViewController:vc animated:YES];
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 1;
}


- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 1;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
